Dialog Box
191473
DialogBox // = DialogBox(WARN+OK, 0) DialogBox(ICON[+BUTTON][+BUTTON]...) DialogBox(BUTTON[+BUTTON][+BUTTON]...) DialogBox(ICON[+BUTTON][+BUTTON]..., timeout) DialogBox(BUTTON[+BUTTON][+BUTTON]..., timeout) DialogBox(, timeout) //= DialogBox(WARN+OK, timeout)
Parameters
ICONS & BUTTONS:
The dialog box expects an optional icon(NotificationLevel) followed by (in principle) any number of buttons. If no icon has been specified, WARN is selected.
The buttons are written with + separated directly behind the icon. If no button has been specified, the OK button is specified implicitly.
TIMEOUT:
Here you can specify a time greater than 0 (in seconds) after which the dialog window should close automatically if the user has not pressed a button. If the dialog window runs into a timeout, DialogBox returns INVALID.
Description
This command can be used to open the predefined, modal dialogs provided by Windows to interrupt the program flow and inform the user, or to ask questions regarding the further flow.
With the default values, the DialogBox command without parameters behaves in the same way as Attention without parameters with the difference that OK on is placed on the stack as the result.
If ClassiX is executed without a connected MorphIT client, the combinations of allowed buttons are subject to the restrictions that also apply to the message box of the WinAPI. Specifically, the following combinations are allowed:
Allowed combinations |
---|
OK |
OK+CANCEL |
RETRY+CANCEL |
YES+NO |
YES+NO+CANCEL |
ABORT+RETRY+IGNORE |
CANCEL+RETRY+CONTINUE |
CANCEL has a special semantics and represents in addition to the "Cancel" button also the X to close the window. If the dialog is closed, CANCEL is returned as result. A dialog that does not specify a CANCEL button cannot be closed by X (timeout works anyway) Example: DialogBox(YES+NO) .
The only exception to this rule is a dialog that only contains the OK button. In this case, the dialog can still be closed with X and OK is returned as the result.
Code example
//Open a dialog box, which gives the user 5 seconds to abort a shutdown T("ClasiX beenden?", "Close ClassiX?") DialogBox(QUESTION+YES+NO, 5) case INVALID: //timeout YES: //YES pressed TerminateApp endCase
Stack | Position | Description |
---|---|---|
Stack(In) | Top | String |
Stack(Out) | Top | BUTTON | INVALID |